
import Vue from 'vue'
import Router from 'vue-router'
 
// 导入页面组件
import home from '@/views/home.vue'
import detail from '@/views/detail.vue'
import summary from '@/views/summary.vue'
Vue.use(Router)
 
const routes = [
  {
    path: '/',
    name: 'home',
    component: home
  },
  {
    path: '/detail',
    name: 'detail',
    component: detail
  },
  {
    path: '/summary',
    name: 'summary',
    component: summary
  }
]
 
const router = new Router({
  base: '/',
  mode: 'history',
  scrollBehavior: () => ({ y: 0 }),
  routes
})

export default router